# ihrm登录接口对象层
import requests
# 定义接口类，添加方法
class IhrmLogin(object):

    # 登录
    @classmethod
    def login(cls,login_data):
        resp = requests.post(url="https://ihrm-java.itheima.net/api/sys/login",
                            # headers={"Content-Type":"application/json"},
                            json=login_data)
        return resp

if __name__ == '__main__':

    login_data = {"mobile": "13800000002", "password": "929itheima.CN032@.20250918"}
    response = IhrmLogin.login(login_data)
    print("登录结果为：",response.json())